import request from '@/utils/request'

// export const getCha=()=> {
// //获取验证码和token
//     request.get('/login/captcha')
// }
export function getcaptcha() {

    return request({
        url: '/login/captcha',
        method: 'get',
        headers: {}
    })
}

export function getmail(mail) {

    return request({
        url: '/sendMail'+'?emailReceiver='+mail,
        method: 'get',
        data: {},
        headers: {}
    })
}
export function getpassword(value,token) {

    return request({
        url: '/forgetPass'+'?token='+token,
        method: 'post',
        data: {
            uid: value.uid,
            mail: value.mail,
            mailCode: value.mailCode,
            newPassword: value.newPassword,
        },
        headers: {}
    })
}
export function userLoginService(formValue, token) {

    return request({
        url: '/login'+'?token='+token,
        method: 'post',
        data: {
            uid: formValue.uid,
            password: formValue.password,
            captcha: formValue.captcha
        },
        // token: token,
        headers: {}
    })
}

export function logout() {

    return request({
        url: '/logout',
        method: 'get',
        data: {},
        headers: {}
    })
}